package com.biglead.orderservice.controller;

import com.biglead.orderservice.service.OrderService;
import com.biglead.orderservice.pojo.OrderInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

     @Value("${server.port}")
     private String serverPort;

    /**
     * 路径： /order/110
     *
     * @param id 订单id
     * @return 用户
     */
    @GetMapping(value = "/{id}")
    public OrderInfo queryById(@PathVariable("id") Long id) {
        log.info("查询订单信息 port {}",serverPort);
        return orderService.queryById(id);
    }
}
